package org.chen.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ImageProcessTask implements Serializable {

    private String articleId;
    private List<ImageInfo> images;
    private String tempPath;
    private Integer retryCount = 0;
    private static final Integer MAX_RETRY = 3;
    
    public void incrementRetryCount() {
        this.retryCount++;
    }
    
    public boolean canRetry() {
        return this.retryCount < MAX_RETRY;
    }
}